package com.aerfafish.spider.neo4j.repository;

import com.aerfafish.spider.neo4j.dao.PersonManage;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

/**
 * @author aerfafish
 * @date 2021/4/21 11:09 上午
 */
@Component
public interface PersonManagerRepository extends Neo4jRepository<PersonManage, Long> {

    @Query("merge (fund:Fund{code: $fundCode}) " +
            "merge (person:Person{code: $managerCode})" +
            "merge p=(person)-[r:PERSON_MANAGE_FUND]->(fund)")
    void save(@Param("managerCode") String managerCode, @Param("fundCode") String fundCode);
}
